package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : txy
 * @Create 2023/10/27 15:38
 */
public class Six {
    public static void main(String[] args) {
        double sum = 0;
        int a = 1, b = 2;
        System.out.print(b + "/" + a);
        for (int i = 0; i < 20; i++) {
            sum = sum + (double) b / a;
            b = a + b;
            a = b - a;
            System.out.print(" + " + b + "/" + a);
        }
        System.out.println(" = " + sum);
    }
}
